package ua.epam.muzalevskiy.traction.configuretion;



import javax.servlet.http.HttpServletRequest;
import ua.epam.muzalevskiy.traction.configuretion.PageViewConfigurer;

/**
 * Current class realized changing of interface language with accordance to
 * current <code>Locale</code> value.
 *
 * @author Muzalevskiy Vitaliy
 */
public class LocaleHelper {
    
    /**
     * This method set text elements of pages as <code>Attributes</code> of
     * <code>HttpServletRequest</code>.
     *
     * @param request - the value of <code>HttpServletRequest</code> to which
     *      <code>Attributes</code> will be added.
     */
    public static void setViewValues(HttpServletRequest request){

            request.getSession().setAttribute("find_route", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.FIND_ROUTE));
            request.getSession().setAttribute("view_schedule", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.VIEW_SCHEDULE));
            request.getSession().setAttribute("traction_routes", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.TRACTION_ROUTES));
            request.getSession().setAttribute("route_information", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ROUTE_INFORMATION));
            request.getSession().setAttribute("registration", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.REGISTRATION));
            request.getSession().setAttribute("registrate", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.REGISTRATE));
            request.getSession().setAttribute("registration_form", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.REGISTRATION_FORM));
            request.getSession().setAttribute("to_main_page", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.TO_MAIN_PAGE));
            request.getSession().setAttribute("to_administration_page", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.TO_ADMINISTRATION_PAGE));
            request.getSession().setAttribute("select_route", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.SELECT_ROUTE));
            request.getSession().setAttribute("schedule", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.SCHEDULE));
            request.getSession().setAttribute("error", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ERROR));
            request.getSession().setAttribute("administration_page", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ADMINISTRATION_PAGE));
            request.getSession().setAttribute("add_stop_to_route", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ADD_STOP_TO_ROUTE));
            request.getSession().setAttribute("add_vehicle_to_route", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ADD_VEHICLE_TO_ROUTE));
            request.getSession().setAttribute("create_new_route", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.CREATE_NEW_ROUTE));
            request.getSession().setAttribute("create_new_stop", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.CREATE_NEW_STOP));
            request.getSession().setAttribute("create_new_vehicle", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.CREATE_NEW_VEHICLE));
            request.getSession().setAttribute("add", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ADD));
            request.getSession().setAttribute("enter_route_id", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_ROUTE_ID));
            request.getSession().setAttribute("enter_vehicle_id", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_VEHICLE_ID));
            request.getSession().setAttribute("enter_vehicle_number", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_VEHICLE_NUMBER));
            request.getSession().setAttribute("enter_vehicle_type", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_VEHICLE_TYPE));
            request.getSession().setAttribute("bus", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.BUS));
            request.getSession().setAttribute("trolleybus", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.TROLLEYBUS));
            request.getSession().setAttribute("tram", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.TRAM));
            request.getSession().setAttribute("create", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.CREATE));
            request.getSession().setAttribute("enter_login", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_LOGIN));
            request.getSession().setAttribute("enter_password", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_PASSWORD));
            request.getSession().setAttribute("enter_email", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTER_EMAIL));
            request.getSession().setAttribute("entering_with_login", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.ENTERING_WITH_LOGIN));
            request.getSession().setAttribute("vehicle_interval", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.VEHICLE_INTERVAL));
            request.getSession().setAttribute("minutes", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.MINUTES));
            request.getSession().setAttribute("stops_it_goes_thru", PageViewConfigurer.getInstance()
                    .getProperty(PageViewConfigurer.STOPS_IT_GOES_THRU));
    }       
}
